package com.myteam.mystory.presention;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.myteam.mystory.R;
import com.myteam.mystory.adapter.ChapterAdapter;

public class ChapterActivity extends Activity {
	
	private ListView listchapter;
	private String[] chapterstory;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.chapter);
		chapterstory = new String[]{"adfasgf","agđgadf","agfdsagag","agfhagfd","agfag","agfah","agfahg","agah","aghadhf","agfah"};
		ChapterAdapter adapter = new ChapterAdapter(ChapterActivity.this, R.id.chapter_name, chapterstory);
		listchapter = (ListView) findViewById(R.id.chapter_listchapter);
		listchapter.setAdapter(adapter);
		listchapter.setOnItemClickListener(new OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
				Intent intent = new Intent(ChapterActivity.this, CurlActivityHoangKien.class);
				startActivity(intent);
			}
			
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.chapter, menu);
		return true;
	}

}
